import json
from celery import Celery,shared_task
celery_app= Celery(main='celerywork.mycelery')
# celery_app.conf.update(broker_url = 'redis://:123456@192.168.117.158:6379/0',
#                          result_backend = 'redis://:123456@192.168.117.158:6379/1',
#                          timezone ="Asia/shanghai",
#                          task_serializer='json',
#                          accept_content=['json'],
#                          enable_utc = True
# )
celery_app.config_from_object('celerywork.celeryconfig')

if __name__ == '__main__':
    celery_app.worker_main(argv=['worker', '--loglevel=info',"--pool=threads",'-c',2])